<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="clic" onClick="clickPro()">点击</div>
  <script>
    var pro1 = new Promise(function(resolve,reject){
      setTimeout(() => {
        resolve('定时器的方法')
      }, 2000);
    })
    var pro2 = new Promise(function(resolve,reject){
      resolve('没有定时器的方法')
    })
    let aaa = document.querySelector('.clic')
    let aa = new Promise(function(resolve,reject){
      reject('bbb')
    }).then(function(res){
      console.log('接收的',res)
      console.log('promise2')
    })
    async function async1(){
      console.log('async1 start')
      await async2()
      console.log('async1 end')
    }
    async function async2(){
      console.log('async2')
    }
    console.log('script start')
    setTimeout(function(){
      console.log('setTimeout') 
    },0)  
    async1();
    
    console.log('script end')


  </script>
</body>
</html>